using Assets.Scripts.GDK;

namespace Brick
{
	public class TopBox : gdk_base_UI
	{
		public void OnShowStopClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			gdk_game_manager.showPanel(PanelID.STOPLAYER);			
		}

		public void OnShopClick()
		{
			GDK.ModuleManger.Module<ShopPanelModule>().SetPage(0);
			gdk_game_manager.PlaySound(AudioID.click);
			gdk_game_manager.showPanel(PanelID.SHOP);
			
		}

		public void OnPropClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			gdk_game_manager.showPanel(PanelID.PROP);			
		}

		public void OnLightClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			int intImgBg = GDK.ModuleManger.Module<TopButtonModule>().getIntImgBg();
			intImgBg = ((intImgBg != 1) ? 1 : 0);
			gdk_game_manager.DispachEvent(EventID.CHOICE_GAME_BG, intImgBg);
			setImgBg(intImgBg);
		}

		public void OnYuLanClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			gdk_game_manager.showPanel(PanelID.YULAN);
		}

		public int getIntImgBg()
		{
			return GameData.curLight;
		}

		public void setImgBg(int index)
		{
			GameData.curLight = index;
		}
	}
}

